home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 2 / LSD and 17bit Compendium Deluxe - Volume II.iso / a / prog / cprog / f2c3.2bin.lha / f2c-for-SASC651 / fsplit.lha / fsplit / machdep.rat < prev    next >
Encoding:
Text File  |  1994-07-07  |  2.4 KB  |  80 lines

  1. #  machdep.rat - machine dependent stuff. This file is part of FSPLIT.
  2. #
  3. #    Copyright (C) 1994 Torsten Poulin
  4. #    Email: torsten@diku.dk
  5. #    Version of 25-JUL-94
  6. #
  7. #  Redistribution and use in source and binary forms, with or without
  8. #  modification, are permitted provided that the following conditions
  9. #  are met:
  10. #
  11. #  1. Redistributions of source code must retain the above copyright
  12. #     notice, this list of conditions and the following disclaimer.
  13. #  2. Redistributions in binary form must reproduce the above copyright
  14. #     notice, this list of conditions and the following disclaimer in the
  15. #     documentation and/or other materials provided with the distribution.
  16. #  3. All advertising materials mentioning features or use of this software
  17. #     must display the following acknowledgement:
  18. #     This product includes software developed by Torsten Poulin.
  19. #  4. The name of Torsten Poulin may not be used to endorse or
  20. #     promote products derived from this software without specific prior
  21. #     written permission.
  22. #
  23. #  This software is provided by Torsten Poulin "as is" and any
  24. #  express or implied warranties, including, but not limited to, the
  25. #  implied warranties of merchantability and fitness for a particular
  26. #  purpose are disclaimed.  In no event shall Torsten Poulin be liable
  27. #  for any direct, indirect, incidental, special, exemplary, or
  28. #  consequential damages (including, but not limited to, procurement
  29. #  of substitute goods or services; loss of use, data, or profits; or
  30. #  business interruption) however caused and on any theory of
  31. #  liability, whether in contract, strict liability, or tort
  32. #  (including negligence or otherwise) arising in any way out of the
  33. #  use of this software, even if advised of the possibility of such
  34. #  damage.
  35.  
  36.  
  37. # Convert character to lowercase.
  38. # ASCII version.
  39. #
  40. # If 'if ... else ...' is replaced by
  41. #
  42. #   switch (c)
  43. #   {
  44. #      case 'A': return ('a')
  45. #      case 'B': return ('b')
  46. #         et cetera
  47. #      case 'Z': return ('z')
  48. #      default:  return (c)
  49. #   }
  50. #
  51. # we get a machine independent, but rather inefficient, version.
  52. #
  53.  
  54. character function tolow(c)
  55.    character c
  56.  
  57.    if (c >= 'A' & c <= 'Z')
  58.       return (char(ichar(c) + 32))
  59.    else
  60.       return (c)
  61. end
  62.  
  63.  
  64. # Is the character c a digit?
  65.  
  66. logical function isdig(c)
  67.    character c
  68.  
  69.    return (c >= '0' & c <= '9')
  70. end
  71.  
  72.  
  73. # Is the character c a lowercase letter?
  74.  
  75. logical function islow(c)
  76.    character c
  77.  
  78.    return (c >= 'a' & c <= 'z')
  79. end
  80.